<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<jsp:useBean id="event" scope="session" class="com.asaga.tools.Event_StubImpl" />
<jsp:useBean id="client" scope="session" class="com.asaga.tools.SystemClient_StubImpl" />
<jsp:useBean id="location" scope="session" class="com.asaga.tools.Location_StubImpl" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<% 
String username = (String)session.getAttribute("username");
if(username==null){
    response.sendRedirect("login.jsp?message=Please log in again.");
}
%>

<html>
    <head>
        <title>ASAA-GGC</title>
        <style title="text/css">@import "style.css"; </style>
        <link rel="stylesheet" href="css/gray.css" type="text/css" title="gray">
        <link rel="stylesheet" href="css/autism.css" type="text/css" />
        <link rel="alternate stylesheet" type="text/css" href="css/red.css" title="red">
        <link rel="alternate stylesheet" type="text/css" href="css/blue.css" title="blue">
        <link rel="alternate stylesheet" type="text/css" href="css/orange.css" title="orange">
        <script type="text/javascript" src="javascript/styleswitcher.js"></script>
    </head>
    
    
    <body>
        <div class="main">
            <%@ include file="header.html" %>
            <div id="content">
                <h2>WELCOME, <%=username%>! (<a href="AutismSiteMasterController?action=logoff">Logout</a>)
                    <div id="colorchange">
                        <ul>
                            <li><a href="#" onclick="setActiveStyleSheet('gray'); return false;" title="Gray Theme"><img src="images/btngray.gif" alt="Gray Theme" /></a></li>
                            <li><a href="#" onclick="setActiveStyleSheet('red'); return false;" title="Red Theme"><img src="images/btnred.gif" alt="Red Theme" /></a></li>
                            <li><a href="#" onclick="setActiveStyleSheet('blue'); return false;" title="Blue Theme"><img src="images/btnblue.gif" alt="Blue Theme" /></a></li>
                            <li><a href="#" onclick="setActiveStyleSheet('orange'); return false;" title="Organe Theme"><img src="images/btnorange.gif" alt="Orange Theme" /></a></li>
                        </ul>
                    </div>
                </h2>
                <p id="warning"><jsp:getProperty name="event" property="warningMessage" />
                </p>
                
                <h4 class="heading">My Events</h4><br />
                <form method="get" action="AutismSiteMasterController">
                        <table class="eventForm">
                            <tr><th></th>
                                <th>Title</th>
                                <th>Date</th>
                                <th>Start Time</th>
                                <th>End Time</th>
                            </tr>
                            <% for(int i = 0; i < event.numberOfEvents(); i++){
                            event.focusOnEvent(i);%>
                            <tr>
                                <td class="selectCell">
                                    <input type="radio" name="id" value="<%=event.tempEvent.id%>" />
                                </td>
                                <td>
                                    <%=event.tempEvent.title%>
                                </td>
                                <td>
                                    <%=event.tempEvent.startDate%>
                                </td>
                                <td>
                                    <%=event.tempEvent.startTime%>
                                </td>
                                <td>
                                    <%=event.tempEvent.endTime%>
                                </td>
                            </tr>
                      
                        <%}%>
                          </table>
                        <table class="eventForm">
                        <tr><td class="buttonCell">
                                <input type="submit" value="View Event" name="action" />
                                <input type ="submit" value="Delete Event" name="action" />
                                <input type = "submit" value="Update Event" name="action" />
                            </td>
                        </tr>
                    </table>  
                </form>     
                
            </div>
        </div>
        <%@ include file="footer.html" %>       
    </body>
</html>
